//
// Created by yangchao on 2022/5/31.
// 104. 二叉树的最大深度: https://leetcode.cn/problems/maximum-depth-of-binary-tree/
//

#include "../DataStructure/TreeNode.h"
#include <vector>
using namespace std;

/*递归*/
class MaxDepth {
public:
    int maxDepth(TreeNode* root) {
        if (root == nullptr) return 0;
        int left = maxDepth(root->left);
        int right = maxDepth(root->right);
        return max(left,right)+1;
    }
};

